#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QLocalSocket>

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

public slots:
    void requestNewFortune();
    void readFortune();
    void displayError(QLocalSocket::LocalSocketError socketError);

private slots:
    void on_getFortuneButton_clicked();

private:
    Ui::Widget *ui;
    QLocalSocket *socket;
    int blockSize;
    QString currentFortune;
};

#endif // WIDGET_H
